// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
const _ = db.command
// 云函数入口函数
exports.main =  (event, context) => {
  return new Promise((resolve, reject) => {
    resolve(db.collection('room').doc(event._id).update({
      data: {
        ready_num: _.inc(1),
        is_start:true,
        users:event.users
      }
    }))  //查询数据并返回给前端  
  })
  
}